//
//  SCImageSequenceImageView.m
//  SnapUpload
//
//  Created by tali on 16/5/25.
//  Copyright © 2016年 JellyKit Inc. All rights reserved.
//

#import "SCImageSequenceImageView.h"

@interface SCImageSequenceImageView ()

@property (nonatomic, strong) NSMutableArray *imageArray;

@end

@implementation SCImageSequenceImageView

-(instancetype)initWithPrefixImageName:(NSString *)prefixImageName andTimeInterval:(CGFloat )timeInterval andTotalCount:(NSInteger)totalCount{
    self = [super init];
    if (self) {
        for (int i=0; i <= totalCount; i++) {
            [self.imageArray safeAddObject:[UIImage imageNamed:[NSString stringWithFormat:@"%@%d",prefixImageName,i]]];
        }
        [self setAnimationImages:self.imageArray];
        self.animationDuration = timeInterval;
        self.animationRepeatCount = 0;
    }
    return self;
}

-(NSMutableArray *)imageArray{
    if (!_imageArray) {
        _imageArray = [NSMutableArray new];
    }
    return _imageArray;
}

@end
